package com.p2p.base.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import com.p2p.base.model.BaseUser;


public interface UserDao {
	@Select("select * from user")
	List<BaseUser> listAllUser();
	
	void saveUser(BaseUser user);
	
	@Select("select * from p2p_user where uname=#{name}")
	@ResultMap(value="userResultMap")
	BaseUser findByName(@Param(value = "name")String name);
	
	@Select("select * from p2p_user where uid=#{uid}")
	@ResultMap(value="userResultMap")
	BaseUser findById(@Param(value = "uid")String uid);
	
	
	@Select("select * from p2p_user where uemail=#{loginName} or umobile=#{loginName}")
	@ResultMap(value="userResultMap")
	BaseUser findByLoginName(@Param(value = "loginName")String loginName);
}
